/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.core.helper;

import org.eclipse.uml2.uml.Element;

/**
 * 
 * 
 * @author Patrick Tessier
 * 
 * This class is used to manage all uml elment in Papyrus.
 */
public interface IUMLElementHelper {

	/**
	 * This method creates an umlElement.
	 * 
	 * @param umlParent the uml elment parent, the parent must not be null.
	 * @param name name of the uml Element to create
	 * 
	 * @return the created the uml Element
	 */
	public org.eclipse.uml2.uml.Element createUMLElement(String name, org.eclipse.uml2.uml.Element umlParent);
	
	/**
	 * This method creates an umlElement.
	 * 
	 * @param umlParent the uml elment parent
	 * if null the elment is create at the model level
	 * 
	 * @return the created the uml Element
	 */
	public org.eclipse.uml2.uml.Element createUMLElement( org.eclipse.uml2.uml.Element umlParent);
	
	/**
	 * This methods adds a umlElement to a umlParent.
	 * 
	 * @param element the element to add
	 * @param umlParent the umlParent that owns the element
	 * 
	 * @return <code>true</code> if the element was added to its umlParent
	 */
	public boolean addUMLElement(org.eclipse.uml2.uml.Element element, org.eclipse.uml2.uml.Element umlParent);
	
	
	/**
	 * This methods adds an umlElement to its owner umlParent.
	 * 
	 * @param element the element to remove
	 * @param umlParent the umlParent of the element to remove
	 * 
	 * @return <code>true</code> if the element was removed
	 */
	public boolean removeUMLElement(org.eclipse.uml2.uml.Element element, org.eclipse.uml2.uml.Element umlParent);

	/**
	 * this method is used to know i we can create an uml element of type factory in the uml parent.
	 * 
	 * @param umlParent that we want to add an element
	 * 
	 * @return true if we can
	 */
	public boolean canCreateUMLElement(Element umlParent); 
	
	/**
	 * Returns a new name for a element creation (unique name within a namespace).
	 * 
	 * @param umlParent the parent of the element to create
	 * 
	 * @return a distinguisable name within the namespace of the umlParent
	 */
	public String getNewUMLElementName(Element umlParent);
	
	/**
	 * Returns a new base name for an element creation (ex: "param" for Parameters).
	 * 
	 * @return a distinguisable name within the namespace of the umlParent
	 */
	public String getBaseString();
	
}
